home *** CD-ROM | disk | FTP | other *** search
/ PC Welt 2001 September / PC-WELT 9-2001.ISO / software / hw / brennen / flask_src.exe / Audio / AC3 / AC3Dec / ac3.h < prev    next >
Encoding:
C/C++ Source or Header  |  2000-05-06  |  1.9 KB  |  63 lines

  1. /* 
  2.  *    ac3.h
  3.  *
  4.  *    Copyright (C) Aaron Holtzman - May 1999
  5.  *
  6.  *  This file is part of ac3dec, a free Dolby AC-3 stream decoder.
  7.  *    
  8.  *  ac3dec is free software; you can redistribute it and/or modify
  9.  *  it under the terms of the GNU General Public License as published by
  10.  *  the Free Software Foundation; either version 2, or (at your option)
  11.  *  any later version.
  12.  *   
  13.  *  ac3dec is distributed in the hope that it will be useful,
  14.  *  but WITHOUT ANY WARRANTY; without even the implied warranty of
  15.  *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
  16.  *  GNU General Public License for more details.
  17.  *   
  18.  *  You should have received a copy of the GNU General Public License
  19.  *  along with GNU Make; see the file COPYING.  If not, write to
  20.  *  the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. 
  21.  *
  22.  *
  23.  */
  24.  
  25. #ifndef AARONS_TYPES
  26. #define AARONS_TYPES
  27. typedef unsigned __int64        uint_64;
  28. typedef unsigned int   uint_32;
  29. typedef unsigned short uint_16;
  30. typedef unsigned char  uint_8;
  31.  
  32. typedef signed   __int64  sint_64;
  33. typedef signed int     sint_32;
  34. typedef signed short   sint_16;
  35. typedef signed char    sint_8;
  36. #endif
  37.  
  38. #define AC3_DOLBY_SURR_ENABLE 0x1
  39. #define AC3_3DNOW_ENABLE      0x2
  40. #define AC3_MMX_ENABLE        0x4
  41. #define AC3_ALTIVEC_ENABLE    0x8
  42.  
  43. typedef struct ac3_config_s
  44. {
  45.     //Bit flags that enable various things
  46.     uint_32 flags;
  47.     //Callback that points the decoder to new stream data
  48.   void   (*fill_buffer_callback)(uint_8 **, uint_8 **);
  49.     //Number of discrete channels in final output (for downmixing)
  50.     uint_16 num_output_ch;
  51.     //Which channel of a dual mono stream to select
  52.     uint_16 dual_mono_ch_sel;
  53. } ac3_config_t;
  54.  
  55. typedef struct ac3_frame_s
  56. {
  57.     uint_32 sampling_rate;
  58.     sint_16 *audio_data;
  59. } ac3_frame_t;
  60.  
  61. void ac3_init(ac3_config_t *config);
  62. ac3_frame_t* ac3_decode_frame(void);
  63.